/*
 * Copyright 2006-2008 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package net.martinimix.domain.payment;

import java.util.Calendar;

/**
 * Provides a credit card authorization response.
 * 
 * @author Scott Rossillo
 *
 */
public class CreditCardAuthorization extends CreditCardTransaction {

	private static final long serialVersionUID = 1L;
	
	/**
	 * The status code for a successful authorization.
	 */
	public final static String STATUS_SUCCESS = "S";
	
	/**
	 * The status code for a failed authorization. 
	 */
	public final static String STATUS_FAILED = "F";
	
	private String merchantReferenceCode;
	private boolean positiveResponse;
	
	/**
	 * @@BusinessObjectProperty("authDecision", attribute=true) 
	 */
	private String decision;
	
	/**
	 * @@BusinessObjectProperty("reasonCode", attribute=true) 
	 */
	private String reasonCode;
	
	/**
	 * @@BusinessObjectProperty("AVSCode", attribute=true) 
	 */
	private String avsCode;
	
	/**
	 * @@BusinessObjectProperty("CVV2Code", attribute=true) 
	 */
	private String cvCode;
	
	/**
	 * @@BusinessObjectProperty("AmexCapnAuth", attribute=true) 
	 */
	private String amexCapnAuthorizationCode;
	
	/**
	 * Creates a new credit card authorization.
	 */
	public CreditCardAuthorization() { }
	
	public CreditCardAuthorization(CreditCardAuthorization other) { }
	

	public String getAmexCapnAuthorizationCode() {
		return amexCapnAuthorizationCode;
	}

	public void setAmexCapnAuthorizationCode(String amexCapnAuthorizationCode) {
		this.amexCapnAuthorizationCode = amexCapnAuthorizationCode;
	}

	public String getAvsCode() {
		return avsCode;
	}

	public void setAvsCode(String avsCode) {
		this.avsCode = avsCode;
	}

	public String getCvCode() {
		return cvCode;
	}

	public void setCvCode(String cvCode) {
		this.cvCode = cvCode;
	}

	public String getMerchantReferenceCode() {
		return merchantReferenceCode;
	}

	public void setMerchantReferenceCode(String merchantReferenceCode) {
		this.merchantReferenceCode = merchantReferenceCode;
	}

	public boolean isPositiveResponse() {
		return positiveResponse;
	}

	public void setPositiveResponse(boolean positiveResponse) {
		this.positiveResponse = positiveResponse;
	}

	public String getDecision() {
		return decision;
	}

	public void setDecision(String decision) {
		this.decision = decision;
	}

	public String getReasonCode() {
		return reasonCode;
	}

	public void setReasonCode(String reasonCode) {
		this.reasonCode = reasonCode;
	}

	public Calendar getAuthorizationDate() {
		return super.getDate();
	}

	public void setAuthorizationDate(Calendar authorizationDate) {
		super.setDate(authorizationDate);
	}
	
}
